Forward progress mechanism for stores in the presence of load contention in a system favoring loads

ABSTRACT

A multiprocessor data processing system includes a plurality of cache memories including a cache memory. In response to the cache memory detecting a storage-modifying operation specifying a same target address as that of a first read-type operation being processed by the cache memory, the cache memory provides a retry response to the storage-modifying operation. In response to completion of the read-type operation, the cache memory enters a referee mode. While in the referee mode, the cache memory temporarily dynamically increases priority of any storage-modifying operation targeting the target address in relation to any second read-type operation targeting the target address.

BACKGROUND OF THE INVENTION

1. Technical Field

The present invention relates generally to data processing and, inparticular, to servicing processor operations in a data processingsystem. Still more particularly, the present invention relates todynamically increasing the priority of storage-modifying operationsrelative to read-type operations in data processing system.

2. Description of the Related Art

A conventional symmetric multiprocessor (SMP) computer system, such as aserver computer system, includes multiple processing units all coupledto a system interconnect, which typically comprises one or more address,data and control buses. Coupled to the system interconnect is a systemmemory, which represents the lowest level of volatile memory in themultiprocessor computer system and which generally is accessible forread and write access by all processing units. In order to reduce accesslatency to instructions and data residing in the system memory, eachprocessing unit is typically further supported by a respectivemulti-level cache hierarchy, the lower level(s) of which may be sharedby one or more processor cores.

Cache memories are commonly utilized to temporarily buffer memory blocksthat might be accessed by a processor in order to speed up processing byreducing access latency introduced by having to load needed data andinstructions from system memory. In some multiprocessor (MP) systems,the cache hierarchy includes at least two levels. The level one (L1) orupper-level cache is usually a private cache associated with aparticular processor core and cannot be accessed by other cores in an MPsystem. Typically, in response to a memory access instruction such as aload or store instruction, the processor core first accesses thedirectory of the upper-level cache. If the requested memory block is notfound in the upper-level cache, the processor core then accesslower-level caches (e.g., level two (L2) or level three (L3) caches) forthe requested memory block. The lowest level cache (e.g., L3) is oftenshared among several processor cores.

Because multiple processor cores may request write access to a samecache line of data and because modified cache lines are not immediatelysynchronized with system memory, the cache hierarchies of multiprocessorcomputer systems typically implement a cache coherency protocol toensure at least a minimum level of coherence among the various processorcore's “views” of the contents of system memory. In particular, cachecoherency requires, at a minimum, that after a processing unit accessesa copy of a memory block and subsequently accesses an updated copy ofthe memory block, the processing unit cannot again access the old copyof the memory block.

A cache coherency protocol typically defines a set of cache statesstored in association with the cache lines of each cache hierarchy, aswell as a set of coherency messages utilized to communicate the cachestate information between cache hierarchies. In many cases, the cachestates and state transitions of the coherence protocol are designed tofavor read-type memory access operations over store-type operations. Theprioritization of read-type operations over store-type operations canlead to forward progress issues for store-type operations in thepresence of significant load contention.

SUMMARY OF THE INVENTION

A multiprocessor data processing system includes a plurality of cachememories including a cache memory. In response to the cache memorydetecting a storage-modifying operation specifying a same target addressas that of a first read-type operation being processed by the cachememory, the cache memory provides a retry response to thestorage-modifying operation. In response to completion of the read-typeoperation, the cache memory enters a referee mode. While in the refereemode, the cache memory temporarily dynamically increases priority of anystorage-modifying operation targeting the target address in relation toany second read-type operation targeting the target address.

BRIEF DESCRIPTION OF THE DRAWINGS

The novel features believed characteristic of the invention are setforth in the appended claims. The invention itself however, as well as apreferred mode of use, further objects and advantages thereof, will bestbe understood by reference to the following detailed description of anillustrative embodiment when read in conjunction with the accompanyingdrawings, wherein:

FIG. 1 is a high-level block diagram of an exemplary data processingsystem in accordance with one embodiment;

FIG. 2 is a more detailed block diagram of an exemplary processing unitin accordance with one embodiment;

FIG. 3 is a detailed block diagram of an L2 cache slice in accordancewith one embodiment;

FIG. 4 is an exemplary timing diagram of the processing of a processormemory access operation in a lower level cache in accordance with oneembodiment;

FIG. 5 is a high level logical flowchart of an exemplary process ofservicing a processor memory access operation in accordance with oneembodiment; and

FIG. 6 is a timing diagram of an exemplary process of servicing aprocessor memory access operation.

DETAILED DESCRIPTION OF ILLUSTRATIVE EMBODIMENT(S)

With reference now to the figures, wherein like reference numerals referto like and corresponding parts throughout, and in particular withreference to FIG. 1, there is illustrated a high-level block diagramdepicting an exemplary data processing system in accordance with oneembodiment. The data processing system is depicted as a cache coherentsymmetric multiprocessor (SMP) data processing system 100. As shown,data processing system 100 includes multiple processing nodes 102 a, 102b for processing data and instructions. Processing nodes 102 are coupledto a system interconnect 110 for conveying address, data and controlinformation. System interconnect 110 may be implemented, for example, asa bused interconnect, a switched interconnect or a hybrid interconnect.

In the depicted embodiment, each processing node 102 is realized as amulti-chip module (MCM) containing four processing units 104 a-104 d,each preferably realized as a respective integrated circuit. Theprocessing units 104 within each processing node 102 are coupled forcommunication to each other and system interconnect 110 by a localinterconnect 114, which, like system interconnect 110, may beimplemented, for example, with one or more buses and/or switches.

As described below in greater detail with reference to FIG. 2,processing units 104 each include a memory controller 106 coupled tolocal interconnect 114 to provide an interface to a respective systemmemory 108. Data and instructions residing in system memories 108 cangenerally be accessed and modified by a processor core in any processingunit 104 of any processing node 102 within data processing system 100.In alternative embodiments, one or more memory controllers 106 (andsystem memories 108) can be coupled to system interconnect 110 ratherthan a local interconnect 114.

Those skilled in the art will appreciate that SMP data processing system100 of FIG. 1 can include many additional non-illustrated components,such as interconnect bridges, non-volatile storage, ports for connectionto networks or attached devices, etc. Because such additional componentsare not necessary for an understanding of the described embodiments,they are not illustrated in FIG. 1 or discussed further herein. Itshould also be understood, however, that the enhancements describedherein are applicable to cache coherent data processing systems ofdiverse architectures and are in no way limited to the generalized dataprocessing system architecture illustrated in FIG. 1.

Referring now to FIG. 2, there is depicted a more detailed block diagramof an exemplary processing unit 104 in accordance with one embodiment.In the depicted embodiment, each processing unit 104 is an integratedcircuit including two processor cores 200 a, 200 b for processinginstructions and data. In a preferred embodiment, each processor core200 is capable of independently executing multiple hardware threads ofexecution simultaneously. As depicted, each processor core 200 includesone or more execution units, such as load-store unit (LSU) 202, forexecuting instructions. The instructions executed by LSU 202 includememory access instructions that request access to a memory block orcause the generation of a request for access to a memory block.

The operation of each processor core 200 is supported by a multi-levelvolatile memory hierarchy having at its lowest level a shared systemmemory 108 accessed via an integrated memory controller 106, and at itsupper levels, one or more levels of cache memory, which in theillustrative embodiment include a store-through level one (L1) cache 226within and private to each processor core 200, and a respective store-inlevel two (L2) cache 230 for each processor core 200 a, 200 b. In orderto efficiently handle multiple concurrent memory access requests tocacheable addresses, each L2 cache 230 can be implemented with multipleL2 cache slices 230 a 1-230 aN, each of which handles memory accessrequests for a respective set of real memory addresses.

Although the illustrated cache hierarchies includes only two levels ofcache, those skilled in the art will appreciate that alternativeembodiments may include additional levels (L3, L4, etc.) of on-chip oroff-chip in-line or lookaside cache, which may be fully inclusive,partially inclusive, or non-inclusive of the contents the upper levelsof cache.

Each processing unit 104 further includes an integrated and distributedfabric controller 216 responsible for controlling the flow of operationson local interconnect 114 and system interconnect 110 and forimplementing the coherency communication required to implement theselected cache coherency protocol. Processing unit 104 further includesan integrated I/O (input/output) controller 214 supporting theattachment of one or more I/O devices (not depicted).

In operation, when a hardware thread under execution by a processor core200 includes a memory access instruction requesting a specified memoryaccess operation to be performed, LSU 202 executes the memory accessinstruction to determine the target real address of the memory accessrequest. LSU 202 then transmits to hash logic 206 within its processorcore 200 at least the memory access request, which includes at least atransaction type (ttype) and a target real address. Hash logic 206hashes the target real address to identify the appropriate destination(e.g., L2 cache slice 230 a 1-230 aN) and dispatches the request forservicing to the appropriate destination.

With reference now to FIG. 3, there is illustrated a more detailed blockdiagram of an exemplary embodiment of one of L2 cache slice 230 a 1-230aN (referred to generically as L2 cache slice 230 a) in accordance withone embodiment. As shown in FIG. 3, L2 cache slice 230 a includes acache array 302 and a directory 308 of the contents of cache array 302.Although not explicitly illustrated, cache array 302 preferably isimplemented with a single read port and single write port to reduce thedie area required to implement cache array 302.

Assuming cache array 302 and directory 308 are set associative as isconventional, memory locations in system memories 108 are mapped toparticular congruence classes within cache array 302 utilizingpredetermined index bits within the system memory (real) addresses. Theparticular memory blocks stored within the cache lines of cache array302 are recorded in cache directory 308, which contains one directoryentry for each cache line. While not expressly depicted in FIG. 3, itwill be understood by those skilled in the art that each directory entryin cache directory 308 includes various fields, for example, a tag fieldthat identifies the real address of the memory block held in thecorresponding cache line of cache array 302, a state field that indicatethe coherency state of the cache line, a LRU (Least Recently Used) fieldindicating a replacement order for the cache line with respect to othercache lines in the same congruence class, and inclusivity bitsindicating whether the memory block is held in the associated L1 cache226.

L2 cache slice 230 a includes multiple (e.g., 16) Read-Claim (RC)machines 312 a-312 n for independently and concurrently servicing load(LD) and store (ST) requests received from the affiliated processor core200. In order to service remote memory access requests originating fromprocessor cores 200 other than the affiliated processor core 200, L2cache slice 230 a also includes multiple snoop machines 311 a-311 m.Each snoop machine 311 can independently and concurrently handle aremote memory access request “snooped” from local interconnect 114. Aswill be appreciated, the servicing of memory access requests by RCmachines 312 may require the replacement or invalidation of memoryblocks within cache array 302. Accordingly, L2 cache slice 230 aincludes CO (castout) machines 310 that manage the removal and writebackof memory blocks from cache array 302.

L2 cache slice 230 a further includes an arbiter 305 that controlsmultiplexers M1-M2 to order the processing of local memory accessrequests received from affiliated processor core 200 and remote requestssnooped on local interconnect 114. Memory access requests, includinglocal load and store operations and remote read and write operations,are forwarded in accordance with the arbitration policy implemented byarbiter 305 to dispatch logic, such as a dispatch pipeline 306, whichprocesses each read/load and store request is processed with respect todirectory 308 and cache array 302 over a given number of cycles.

L2 cache slice 230 a also includes an RC queue 320 and a CPI (castoutpush intervention) queue 318 that respectively buffer data beinginserted into and removed from the cache array 302. RC queue 320includes a number of buffer entries that each individually correspond toa particular one of RC machines 312 such that each RC machine 312 thatis dispatched retrieves data from only the designated buffer entry.Similarly, CPI queue 318 includes a number of buffer entries that eachindividually correspond to a particular one of the castout machines 310and snoop machines 311, such that each CO machine 310 and each snooper311 that is dispatched retrieves data from only the respectivedesignated CPI buffer entry.

Each RC machine 312 also has assigned to it a respective one of multipleRC data (RCDAT) buffers 322 for buffering a memory block read from cachearray 302 and/or received from local interconnect 114 via reload bus323. The RCDAT buffer 322 assigned to each RC machine 312 is preferablyconstructed with connections and functionality corresponding to thememory access requests that may be serviced by the associated RC machine312. RCDAT buffers 322 have an associated store data multiplexer M4 thatselects data bytes from among its inputs for buffering in the RCDATbuffer 322 in response unillustrated select signals generated by arbiter305.

In operation, processor store requests comprising a transaction type(ttype), target real address and store data are received from theaffiliated processor core 200 within a store queue (STQ) 304. From STQ304, the store data are transmitted to store data multiplexer M4 viadata path 324, and the store type and target address are passed tomultiplexer M1. Multiplexer M1 also receives as inputs processor loadrequests from processor core 200 and directory write requests from RCmachines 312. In response to unillustrated select signals generated byarbiter 305, multiplexer M1 selects one of its input requests to forwardto multiplexer M2, which additionally receives as an input a remoterequest received from local interconnect 114 via remote request path326. Arbiter 305 schedules local and remote memory access requests forprocessing and, based upon the scheduling, generates a sequence ofselect signals 328. In response to select signals 328 generated byarbiter 305, multiplexer M2 selects either the local request receivedfrom multiplexer M1 or the remote request snooped from localinterconnect 114 as the next memory access request to be processed.

Referring now to FIG. 4, there is depicted a time-space diagram of anexemplary operation on the interconnect fabric of data processing system100 of FIG. 1. The operation begins with a request phase 450 in which amaster 400, for example, an RC machine 312 of an L2 cache 230, issues arequest 402 on the interconnect fabric. Request 402 preferably includesat least a transaction type indicating a type of desired access and aresource identifier (e.g., real address) indicating a resource to beaccessed by the request. Common types of requests preferably includethose set forth below in Table I.

TABLE I Request Description READ Requests a copy of the image of amemory block for query purposes RWITM (Read- Requests a unique copy ofthe image of a memory With-Intent-To- block with the intent to update(modify) it and Modify) requires destruction of other copies, if anyDCLAIM (Data Requests authority to promote an existing query-only Claim)copy of memory block to a unique copy with the intent to update (modify)it and requires destruction of other copies, if any DCBZ (Data Requestsauthority to create a new unique copy of a Cache Block memory blockwithout regard to its present state and Zero) subsequently modify itscontents; requires destruction of other copies, if any CASTOUT Copiesthe image of a memory block from a higher level of memory to a lowerlevel of memory in preparation for the destruction of the higher levelcopy WRITE Requests authority to create a new unique copy of a memoryblock without regard to its present state and immediately copy the imageof the memory block from a higher level memory to a lower level memoryin preparation for the destruction of the higher level copy PARTIALRequests authority to create a new unique copy of a WRITE partial memoryblock without regard to its present state and immediately copy the imageof the partial memory block from a higher level memory to a lower levelmemory in preparation for the destruction of the higher level copy

Request 402 is received by snoopers 404, for example, snoopers 311 a-311m of L2 cache slice 230 a. In general, with some exceptions, snoopers311 in the same L2 cache 230 a as the master of request 402 do not snooprequest 402 (i.e., there is generally no self-snooping) because arequest 402 is transmitted on the interconnect fabric only if therequest 402 cannot be serviced internally by a processing unit 104.

The operation continues with a partial response phase 455. Duringpartial response phase 455, snoopers 404 that receive and processrequests 402 each provide a respective partial response 406 representingthe response of at least that snooper 404 to request 402. A snooper 404within an integrated memory controller 106 determines the partialresponse 406 to provide based, for example, upon whether that snooper404 is responsible for the request address and whether it has resourcesavailable to service the request. A snooper 404 of an L2 cache 230 maydetermine its partial response 406 based on, for example, theavailability of its L2 cache directory 308, the availability of a snooplogic instance 311 within the snooper 404 to handle the request, and thecoherency state associated with the request address in L2 cachedirectory 308.

The operation continues with a combined response phase 460. Duringcombined response phase 460, the partial responses 406 of snoopers 404are logically combined either in stages or all at once by one or moreinstances of response logic 422 to determine a system-wide combinedresponse (referred to herein as “CR” or “Cresp”) 410 to request 402. Inone preferred embodiment, which will be assumed hereinafter, theinstance of response logic 422 responsible for generating combinedresponse 410 is located in the processing unit 104 containing the master400 that issued request 402, for example, in fabric controller 216.Response logic 422 provides combined response 410 to master 400 andsnoopers 404 via the interconnect fabric to indicate the system-wideresponse (e.g., success, failure, retry, etc.) to request 402. If the CR410 indicates success of request 402, CR 410 may indicate, for example,a data source for a requested memory block, a cache state in which therequested memory block is to be cached by master 400, and whether“cleanup” operations invalidating the requested memory block in one ormore L2 caches 230 are required.

In response to receipt of combined response 410, one or more of master400 and snoopers 404 typically perform one or more operations in orderto service request 402. These operations may include supplying data tomaster 400, invalidating or otherwise updating the coherency state ofdata cached in one or more L2 caches 230, performing castout operations,writing back data to a system memory 108, etc. If required by request402, a requested or target memory block may be transmitted to or frommaster 400 before or after the generation of combined response 410 byresponse logic 422.

In the following description, the partial response 406 of a snooper 404to a request 402 and the operations performed by the snooper 404 inresponse to the request 402 and/or its combined response 410 will bedescribed with reference to whether that snooper is a Highest Point ofCoherency (HPC), a Lowest Point of Coherency (LPC), or neither withrespect to the request address specified by the request. An LPC isdefined herein as a memory device or I/O device that serves as theultimate repository for a memory block. In the absence of a cachingparticipant that holds a copy of the memory block, the LPC holds theonly image of that memory block. In the absence of an HPC cachingparticipant for the memory block, the LPC has the sole authority togrant or deny requests to modify the memory block. In addition, an LPC,when the LPC data is current and in the absence of a caching participantthat can provide the data, provides that data to requests to either reador modify the memory block. If a caching participant has a more currentcopy of the data, but is unable to provide it to a request, the LPC doesnot provide stale data and the request is retried. For a typical requestin the data processing system embodiment, the LPC will be the memorycontroller 106 for the system memory 108 holding the referenced memoryblock. An HPC is defined herein as a uniquely identified device thatcaches a true image of the memory block (which may or may not beconsistent with the corresponding memory block at the LPC) and has theauthority to grant or deny a request to modify the memory block.Descriptively, the HPC (even if its copy is consistent with main memorybehind the LPC) also provides a copy of the memory block to a requestorin response to any request to read or modify the memory block (cache tocache transfers are faster than LPC to cache transfers). Thus, for atypical request in the data processing system embodiment, the HPC, ifany, will be an L2 cache 230. Although other indicators may be utilizedto designate an HPC for a memory block, a preferred embodimentdesignates the HPC, if any, for a memory block utilizing selected cachecoherency state(s) within the L2 cache directory 308 of an L2 cache 230.In a preferred embodiment, the coherency states within the coherencyprotocol, in addition to providing (1) an indication of whether a cacheis the HPC for a memory block, also indicate (2) whether the cached copyis unique (i.e., is the only cached copy system-wide), (3) whether andwhen the cache can provide a copy of the memory block to a master of arequest for the memory block, and (4) whether the cached image of thememory block is consistent with the corresponding memory block at theLPC (system memory). These four attributes can be expressed, forexample, in an exemplary variant of the well-known MESI (Modified,Exclusive, Shared, Invalid) protocol summarized below in Table II.Further information regarding the coherency protocol may be found, forexample, in U.S. Pat. No. 7,389,388, which is hereby incorporated byreference.

TABLE II Consistent Cache with Legal concurrent state HPC? Unique? Datasource? LPC? states M Yes yes Yes, before CR no I (& LPC) Me Yes yesYes, before CR yes I (& LPC) T, Te Yes unknown Yes, after CR if noneprovided no S_(L), S, I (& LPC) before CR S_(L) No unknown Yes, beforeCR unknown T, S, I (& LPC) S No unknown No unknown T, S_(L), S, I (&LPC) I no n/a No n/a M, Me, T, S_(L), S, I (& LPC)

Of note in Table II above are the T, S_(L) and S states, which are all“shared” coherency states in that a cache memory may contemporaneouslyhold a copy of a cache line held in any of these states by another cachememory. The T or Te state identifies an HPC cache memory that formerlyheld the associated cache line in one of the M or Me states,respectively, and sourced a query-only copy of the associated cache lineto another cache memory. As an HPC, a cache memory holding a cache linein the T or Te coherence state has the authority to modify the cacheline or to give such authority to another cache memory. A cache memoryholding a cache line in the Tx state (e.g., T or Te) serves as the cachedata source of last resort (after Cresp) for query-only copies of thatcache line in that the cache memory will only source a query-only copyto another cache memory if no cache memory holding the cache line in theS_(L) state is available to serve as a data source (before Cresp).

The S_(L) state is formed at a cache memory in response to that cachememory receiving a query-only copy of a cache line from a cache memoryin the T coherence state. Although the S_(L) state is not an HPCcoherence state, a cache memory holding a cache line in the S_(L) statehas the ability to source a query-only copy of that cache line toanother cache memory and can do so prior to receipt of Cresp. Inresponse to sourcing a query-only copy of a cache line to another cachememory (which assumes the S_(L) state), the cache memory sourcing thequery-only copy of the cache line updates its coherency state for thecache line from S_(L) to S. Thus, implementation of the S_(L) coherencestate can cause numerous query-only copies of frequently queried cachelines to be created throughout a multiprocessor data processing system,advantageously decreasing latencies of query-only access to those cachelines.

Referring again to FIG. 4, the HPC, if any, for a memory blockreferenced in a request 402, or in the absence of an HPC, the LPC of thememory block, preferably has the responsibility of protecting thetransfer of ownership of a memory block, if necessary, in response to arequest 402. In the exemplary scenario shown in FIG. 4, a snooper 404 nat the HPC (or in the absence of an HPC, the LPC) for the memory blockspecified by the request address of request 402 protects the transfer ofownership of the requested memory block to master 400 during aprotection window 412 a that extends from the time that snooper 404 ndetermines its partial response 406 until snooper 304 n receivescombined response 410 and during a subsequent window extension 412 bextending a programmable time beyond receipt by snooper 404 n ofcombined response 410. During protection window 412 a and windowextension 412 b, snooper 404 n protects the transfer of ownership byproviding partial responses 406 to other requests specifying the samerequest address that prevent other masters from obtaining ownership(e.g., a retry partial response) until ownership has been successfullytransferred to master 400. Master 400 likewise initiates a protectionwindow 413 to protect its ownership of the memory block requested inrequest 402 following receipt of combined response 410.

Because snoopers 404 all have limited resources for handling the CPU andI/O requests described above, several different levels of partialresponses and corresponding CRs are possible. For example, if a snooperwithin a memory controller 106 that is responsible for a requestedmemory block has a queue available to handle a request, the snooper mayrespond with a partial response indicating that it is able to serve asthe LPC for the request. If, on the other hand, the snooper has no queueavailable to handle the request, the snooper may respond with a partialresponse indicating that it is the LPC for the memory block, but isunable to currently service the request. Similarly, a snooper 311 in anL2 cache 230 may require an available instance of snoop logic and accessto L2 cache directory 406 in order to handle a request. Absence ofaccess to either (or both) of these resources results in a partialresponse (and corresponding CR) signaling an inability to service therequest due to absence of a required resource.

As discussed above, read-type operations are generally prioritized overstore-type operations in data processing systems because the timecritical path through a software program is generally determined by loadlatency. The prioritization of read-type operations over store-typeoperations can be expressed in a number of data processing systemattributes, including the hardware architecture, memory model andcoherency protocol implemented by a given data processing system. Forexample, the coherency protocol summarized in Table II reflects thisprioritization by favoring the formation of numerous distributedquery-only (S_(L) or S) copies of a frequently queried cache linethroughout a multiprocessor data processing system. While theavailability of numerous sources of a query-only copy of a cache linereduces access latency of non-storage-modifying operations, the presenceof many copies of the cache line distributed throughout the dataprocessing system can increase the access latency of storage-modifyingaccesses because any one of the cache memories holding a query-only copyof the cache line and servicing a request for query-only access canforce a competing request for storage-modifying access to be retried. Incertain cases, repeated retry of the storage-modifying access can slowor even halt forward progress of the program (e.g., if thestorage-modifying access is required to release a highly contendedlock).

In particular, in the coherence protocol described above, an HPC in a Txstate is required to protect the first read operation it sees and retryall other read and modification operations to that address until atleast Cresp for that read. This is to ensure that in the absence of anS_(L) copy to source the read data (ether due to the S_(L) being busywith another request or being absent altogether), the HPC cache willprovide the data. In the event that the HPC cache is modified relativeto main memory in the LPC and the S_(L) cache is absent altogether, theHPC must perform this function as the LPC data is stale and the HPCcache must provide the data. In the other cases, it is preferential tohave the HPC provide the data as the cache to cache transfer (even afterCresp), is more efficient than an LPC to cache transfer. As such, in thepresence of significant numbers of querying read caches, a single cacheattempting to store to a location (for example to release a lock) mayhave significant difficulty getting to the HPC and obtaining permissionto modify the memory block since a significant portion of the time, theHPC is busy serving as the data source of last resort and is unable tolock on to the block modification request.

As described in detail below with reference to FIGS. 5-6, performanceissues associated with read prioritization can be addressed bytemporarily and dynamically increasing the priority of store-typeoperations relative to read-type operations so that a store may moreeffectively compete to be recognized by the HPC cache. In at least someembodiments, the priority of store-type operations are increasedrelative to read-type operations by forcing read-type operationstargeting cache lines for which contention is detected to be retried.

Turning now to FIG. 5, there is illustrated a high level logicalflowchart of an exemplary process by which a cache memory dynamicallyprioritizes the handling of store operations over read operations inaccordance with one embodiment. For clarity, the flowchart of FIG. 5will be described herein in conjunction with timing diagram 600 of FIG.6.

The process depicted in FIG. 5 begins at block 500 in response to an L2cache memory 230 that holds a target cache line of a read-type operationin a shared, modified coherence state (e.g., the Tx state) snooping theread operation from local interconnect 114. The read-type operation maybe a READ operation as previously described or any othernon-storage-modifying access to a target cache line. At block 502,dispatch logic 306 of the L2 cache memory 230 dispatches a snoop machine311 to handle the read-type operation snooped from local interconnect114, as depicted at reference numeral 602 in FIG. 6 by the transition ofthe snoop machine 311 from an idle state to a busy state. The dispatchedsnoop machine 311 accordingly begins protection for the target addressof the snooped read-type operation. Said another way, while theread-type operation is being processed by the dispatched snoop machine311, any subsequently received store-type operation while snooper iscompleting normal processing for the read, as depicted at referencenumber 606 in FIG. 6, having the same target address will receive aretry partial response from the L2 cache 230 (and consequently a retryCresp that forces the master of the store-type operation to reissue thestore-type operation in order to update the cache line associated withthe target address). In one or more embodiments, the read-type operationand store-type operation have a target address that is associated with ashared modified cache state, for example, cache state “T” or “Te”, asdescribed above.

As illustrated at block 504, if the snoop machine 311 has completed itsprocessing of the read operation as depicted at reference numeral 604 ofFIG. 6, the process proceeds to block 510, which is described below. If,at decision block 504, snoop machine 311 has not completed processing ofthe read operation, the process continues at block 505, whichillustrates snoop machine 311 performing normal processing of thesnooped read-type operation, which may include, for example, sourcingthe target cache line to the requesting master by cache-to-cacheintervention in response to receipt of a combined response indicatingsuccess of the read-type operation. At block 506, the snoop machine 311determines whether or not it has detected a competing store-typeoperation, as depicted at reference numeral 606 of FIG. 6, that is, astore-type operation (i.e., any storage-modifying operation) that hasthe same target address as the snooped read-type operation and that wasoriginated by another execution thread. As noted above, because thesnoop machine 311 is already active processing a read-type operationdirected to the target cache line, any conflicting store-type operationsubsequently received while snoop machine 311 is processing theread-type operation will be given a retry partial response by the L2. Inresponse to detecting a competing store-type operation at block 506,snoop machine 311 sets a flag to later enter a “referee” mode in which astore-type operation to the target cache line will be temporarilyprioritized over any read-type operations to the target cache line, asdepicted at block 508 of FIG. 5 and reference numeral 608 of FIG. 6. Inone embodiment, the snoop machine only sets the flag to later enter thereferee mode when the cache state associated with the target address isa shared modified state. Following block 508, the process returns toblock 504, which has been described.

Referring now to block 510, after completing processing of the read-typeoperation, the snoop machine 311 determines whether or not the refereemode flag is set. If not, snoop machine 311 returns to an idle state, asillustrated in FIG. 5 at block 512 and in FIG. 6 at reference numeral610. Following block 512, the process illustrated in FIG. 5 ends atblock 513. Returning to block 510, if the snoop machine 311 determinesthe flag is set to enter referee mode, the snoop machine 311 does notreturn to the idle state upon completion of processing the read-typeoperation, but instead enters referee mode, as shown at block 514 ofFIG. 5 and reference numeral 614 of FIG. 6. In conjunction with enteringthe referee mode, the snoop machine 311 also starts a timer, in oneembodiment.

At block 516, the snoop machine 311 determines if it has detected acompeting read-type operation, as depicted at reference numeral 618 ofFIG. 6, directed to the same target cache line as that targeted by thecompeting store-type operation. If so, then the snoop machine 311provides a retry partial response to the competing read-type operation,as shown at block 518 of FIG. 5. Thereafter, the process returns toblock 516, which has been described.

If the snoop machine 311 has not detected a competing read-typeoperation at block 516, the snoop machine 311 determines at block 520 ifa timeout of the referee mode has occurred. In various embodiments, atimeout may occur at a static predetermined timer value, oralternatively, at a dynamic value determined based on, for example, anumber of competing read-type operations received during referee mode orwhen a ratio of a number of competing read-type operations to a numberof store-type operations is reached. In response to determining at block520 that the referee mode has timed out, the process proceeds to block528, which illustrates the snoop machine 311 exiting referee mode (notdepicted on FIG. 6). Thereafter, the snoop machine 311 is set to idle(block 512 of FIG. 5). If, however, the snoop machine 311 determines atblock 520 that the referee mode has not timed out, snoop machine 311further determines at block 522 whether a store-type operation targetingthe target address of the previously processed read-type operation hasbeen received. In the case of significant read contention against asingle store releasing a lock, any such store-type operation most likelyrepresents the master of the previous store-type operation that receiveda retry partial response reissuing a store-type operation to the sametarget address. If snoop machine 311 detects a store-type operation tothe target address of the previously processed read-type operation, theprocess proceeds to block 524, described below. If, however, the snoopmachine 311 does not detect a store-type operation to the same targetaddress as that of the previously processed read-type operation, theprocess returns to block 516, which has been described.

Referring now to block 524, the snoop machine 311 exits referee mode,meaning that read-type operations are again prioritized above store-typeoperations. The exit from referee mode is illustrated at referencenumeral 612 of FIG. 6.

At block 526, the snoop machine 311 processes the store-type operationnormally, for example, by invalidating the target cache line indirectory 308, and depending on the type of store-type operation,providing a copy of the target cache line to the requesting master inresponse to receipt of a Cresp indicating success of the store-typeoperation. Processing of the store-type operation by a different snoopmachine 311 is depicted in FIG. 6 at reference numeral 630. Thoseskilled in the art will realize that in other embodiments, it would bepossible to have the same snoop machine that was in referee mode alsoprocess the store 626 of FIG. 6. Whether it is feasible or advantageousto do so depends on specific implementation issues that vary fromembodiment to embodiment. Thereafter, the process passes to block 512,which has been described.

In alternative embodiments of the process of FIG. 5 having more granularprioritization between read-type and store-type operations, snoopmachine 311 may elect to force the retry of less than all of thecompeting read-type operations received while in referee mode (e.g.,one-half or three-fourths). Further, in at least some embodiments, thescope of retry enforced by the referee mode could extend to a memoryregion larger than a single cache line (e.g., a memory page or othersized memory block). Further, in at least some embodiments, the durationof the referee mode may extend beyond receipt of a single store-typeoperation for the target cache line for which contention exists.

As has been described, a multiprocessor data processing system includesa plurality of cache memories including a cache memory. In response tothe cache memory detecting a storage-modifying operation specifying asame target address as that of a first read-type operation beingprocessed by the cache memory, the cache memory provides a retryresponse to the storage-modifying operation. In response to completionof the read-type operation, the cache memory entering a referee mode.While in the referee mode, the cache memory temporarily dynamicallyincreases priority of any storage-modifying operation targeting thetarget address in relation to any second read-type operation targetingthe target address.

While various embodiments have been particularly shown and described, itwill be understood by those skilled in the art that various changes inform and detail may be made therein without departing from the spiritand scope of the appended claims and these alternate implementations allfall within the scope of the appended claims.

1.-6. (canceled)
 7. A cache memory for a multiprocessor data processingsystem, the cache memory comprising: a data array; a directory ofcontents of the data array; a snoop machine that processes operationsreceived from an interconnect, wherein the snoop machine, responsive todetecting a first storage-modifying operation specifying a same targetaddress as that of a first read-type operation being processed by thecache memory, causes the cache memory to provide a retry response to thestorage-modifying operation and, in response to completion of theread-type operation, enter a referee mode, wherein the snoop machine,while in the referee mode, temporarily dynamically increases priority ofany second storage-modifying operation targeting the target address inrelation to any second read-type operation targeting the target address.8. The cache memory of claim 7, wherein the snoop machine temporarilydynamically increases priority of any second storage-modifying access tothe target address by providing a retry response to a second read-typeoperation in absence at the cache memory of another pending operationspecifying the target address.
 9. The cache memory of claim 7, whereinthe snoop machine, responsive to receiving the second storage-modifyingoperation specifying the same target address while in referee mode,exits the referee mode and services the second storage-modifyingoperation.
 10. The cache memory of claim 9, wherein the firststorage-modifying operation and the second storage-modifying operationare received from a same master.
 11. The cache memory of claim 7,wherein the snoop machine detects a timeout condition in absence ofreceiving a second storage-modifying operation specifying the sametarget address, and in response to detecting the timeout condition,exits referee mode.
 12. The cache memory of claim 7, wherein the cachememory only enters referee mode if a cache state associated with thetarget address is a shared modified state.
 13. A processing unit,comprising: a cache memory according to claim 7; and at least oneprocessor core coupled to the cache memory.
 14. A multi-processor dataprocessing system, comprising: a plurality of processing units eachcomprising a cache memory; and a system interconnect connecting theplurality of processing units, wherein a specific cache memory of one ofthe plurality of processing units comprises a snoop machine thatprocesses operations received from an interconnect, wherein the snoopmachine, responsive to detecting a first storage-modifying operationspecifying a same target address as that of a first read-type operationbeing processed by the cache memory, causes the specific cache memory toprovide a retry response to the storage-modifying operation and, inresponse to completion of the read-type operation, enter a referee mode,wherein the snoop machine, while in the referee mode, temporarilydynamically increases priority of any second storage-modifying operationtargeting the target address in relation to any second read-typeoperation targeting the target address.
 15. The multi-processor dataprocessing system of claim 14, wherein the snoop machine temporarilydynamically increases priority of any second storage-modifying access tothe target address by providing a retry response to a second read-typeoperation in absence at the specific cache memory of another pendingoperation specifying the target address.
 16. The multi-processor dataprocessing system of claim 14, wherein the snoop machine, responsive toreceiving the second storage-modifying operation specifying the sametarget address while in referee mode, exits the referee mode andservices the second storage-modifying operation.
 17. The multi-processordata processing system of claim 16, wherein the first storage-modifyingoperation and the second storage-modifying operation are received from asame master.
 18. The multi-processor data processing system of claim 14,wherein the snoop machine detects a timeout condition in absence ofreceiving a second storage-modifying operation specifying the sametarget address, and in response to detecting the timeout condition,exits referee mode.
 19. The multi-processor data processing system ofclaim 14, wherein the specific cache memory only enters referee mode ifa cache state associated with the target address is a shared modifiedstate.